home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / scsh-0.4 / scsh-0 / scsh-0.4.2 / .gdbinit next >
Text File  |  1995-10-13  |  2KB  |  107 lines

  1. #
  2. # Commands useful for debugging the Scheme48 VM.
  3. #
  4.  
  5. #Set a breakpoint at label "raise".
  6. #Obtain the proper line number using "egrep -n raise: scheme48vm.c".
  7. #break scheme48vm.c:4831
  8.  
  9. #display/i $pc
  10.  
  11. define scsh
  12. run -o ./scshvm -i ./scsh/scsh.image
  13. end
  14. #
  15. document scsh
  16. For testing scsh -bri
  17. end
  18.  
  19. define pcont
  20. echo template id = \ 
  21. output *(long *)((*(long *)(($ & ~3) + 8) & ~3) + 4) / 4
  22. echo \npc = \ 
  23. output (*(long *)(($ & ~3) + 4) / 4)
  24. echo \nparent = \ 
  25. output *(long *)($ & ~3)
  26. echo \nenv = \ 
  27. output *(long *)(($ & ~3) + 12)
  28. echo \ncount = \ 
  29. output *(long *)(($ & ~3) - 4) >> 10
  30. echo \n
  31. end
  32. #
  33. document pcont
  34. Print $ as a continuation.
  35. end
  36.  
  37.  
  38. define parent
  39. print *(long *)($ & ~3)
  40. pcont
  41. end
  42. #
  43. document parent
  44. Select parent continuation.
  45. end
  46.  
  47.  
  48. define preview
  49. set $cont = ScontS
  50. preview-loop
  51. end
  52. #
  53. define preview-loop
  54. output $cont
  55. echo \040
  56. output *(long *)((*(long *)(($cont & ~3) + 8) & ~3) + 4) / 4
  57. echo \n
  58. set $cont = *(long *)($cont & ~3)
  59. preview-loop
  60. end
  61. #
  62. document preview
  63. Display Scheme stack trace.  Look up the template uids in the .debug file.
  64. end
  65.  
  66.  
  67. define show-header
  68. echo Header length:\ 
  69. output $hdr >> 8
  70. echo \ type:\040
  71. output ($hdr & 127) >> 2
  72. echo \ tag:\040
  73. output $hdr & 3
  74. echo \n
  75. end
  76.  
  77. define look
  78. output ($ - Snewspace_beginS)
  79. echo :\n
  80. set $hdr = *(long *)($ - 7)
  81. show-header
  82. output *(long *)($ - 3)
  83. echo \n
  84. output *(long *)($ + 1)
  85. echo \n
  86. output *(long *)($ + 5)
  87. echo \n
  88. end
  89.  
  90. define go0
  91. print *(long *)($ - 3)
  92. end
  93.  
  94. define bytes
  95. set $foo = RScode_pointerS
  96. output (int)*(unsigned char *)($foo + 0)
  97. echo \040
  98. output (int)*(unsigned char *)($foo + 1)
  99. echo \040
  100. output (int)*(unsigned char *)($foo + 2)
  101. echo \040
  102. output (int)*(unsigned char *)($foo + 3)
  103. echo \040
  104. output (int)*(unsigned char *)($foo + 4)
  105. echo \n
  106. end
  107.